#include<iostream>
using namespace std;
bool idf(int x)
{
	for (int i = 2; i<x; i++)
	if (x%i == 0)
		return false;
	return true;
}
int main()
{
	int m, t;
	while (cin >> m)
	{
		t = m / 2;
		if (idf(t))
			cout << t << endl << t << endl;
		else{
			while (idf(--t) == 0 || idf(m - t) == 0)
			{

			}
			cout << t << endl << m - t << endl;
		}
	}
}